/**
 * Created by zzy on 2017/10/25.
 */
import React, {Component} from 'react';
import {
    Image
} from 'react-native';
export default class CommonUtil{
    static getStoreStars(score){
        let starNum=parseInt(score/2);
        let halfStarNum=score%2;
        let stars=[];
        for(let i = 0;i<starNum;i++){
            stars.push( <Image  key={i} style={{width:12,height:12}} source={require('../../asserts/shop/icon_star_orange.png')}></Image>)
            if(stars.length==5)return stars;
        }
        if(halfStarNum!=0)stars.push( <Image  key={starNum+1} style={{width:12,height:12}} source={require('../../asserts/shop/icon_star_half.png')}></Image>)
        for(let k = 0;k<5-halfStarNum-starNum;k++){
            stars.push( <Image  key={5+k} style={{width:12,height:12}} source={require('../../asserts/shop/icon_star_gray.png')}></Image>)
        }
        return stars;
    }
}